package com.ciwong.epaper.modules.msg.util;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间戳 工具类
 * Created by res-yinxue on 2016/6/24.
 */
public class MsgDateFormat {
    public MsgDateFormat(){}


    public static String formatDate(long dateLong) {
        try {
            Date e = new Date(dateLong);
            SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
            return format.format(e);
        } catch (Exception var4) {
            var4.printStackTrace();
            return null;

        }
    }

    public static String formatDateXieGan(long dateLong) {
        try {
            Date e = new Date(dateLong);
            SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm");
            return format.format(e);
        } catch (Exception var4) {
            var4.printStackTrace();
            return null;

        }
    }
    public static String formatDate2(int  days) {
        try {
            long daysTime =  1000 * 60L * 60L * 24*days;
            Date e = new Date(daysTime+System.currentTimeMillis());
            SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
            return format.format(e.getTime());
        } catch (Exception var4) {
            var4.printStackTrace();
            return null;
        }
    }

    public static String formatDate3(int  days) {
        try {
            long daysTime =  1000 * 60L * 60L * 24*days;
            Date e = new Date(daysTime+System.currentTimeMillis());
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
            return format.format(e.getTime());
        } catch (Exception var4) {
            var4.printStackTrace();
            return null;
        }
    }
}
